3.198 \(\int \tan ^5(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=105 \[ \frac{b (2 a-b) \tan ^6(e+f x)}{6 f}+\frac{(a-b)^2 \tan ^4(e+f x)}{4 f}-\frac{(a-b)^2 \tan ^2(e+f x)}{2 f}-\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{b^2 \tan ^8(e+f x)}{8 f} \]

[Out]

-(((a - b)^2*Log[Cos[e + f*x]])/f) - ((a - b)^2*Tan[e + f*x]^2)/(2*f) + ((a - b)^2*Tan[e + f*x]^4)/(4*f) + ((2
*a - b)*b*Tan[e + f*x]^6)/(6*f) + (b^2*Tan[e + f*x]^8)/(8*f)

________________________________________________________________________________________

Rubi [A]  time = 0.108878, antiderivative size = 105, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 88} \[ \frac{b (2 a-b) \tan ^6(e+f x)}{6 f}+\frac{(a-b)^2 \tan ^4(e+f x)}{4 f}-\frac{(a-b)^2 \tan ^2(e+f x)}{2 f}-\frac{(a-b)^2 \log (\cos (e+f x))}{f}+\frac{b^2 \tan ^8(e+f x)}{8 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^5*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-(((a - b)^2*Log[Cos[e + f*x]])/f) - ((a - b)^2*Tan[e + f*x]^2)/(2*f) + ((a - b)^2*Tan[e + f*x]^4)/(4*f) + ((2
*a - b)*b*Tan[e + f*x]^6)/(6*f) + (b^2*Tan[e + f*x]^8)/(8*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin{align*} \int \tan ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^5 \left (a+b x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x^2 (a+b x)^2}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (-(a-b)^2+(a-b)^2 x+(2 a-b) b x^2+b^2 x^3+\frac{(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac{(a-b)^2 \log (\cos (e+f x))}{f}-\frac{(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac{(a-b)^2 \tan ^4(e+f x)}{4 f}+\frac{(2 a-b) b \tan ^6(e+f x)}{6 f}+\frac{b^2 \tan ^8(e+f x)}{8 f}\\ \end{align*}

Mathematica [A]  time = 0.339334, size = 89, normalized size = 0.85 \[ \frac{4 b (2 a-b) \tan ^6(e+f x)+6 (a-b)^2 \tan ^4(e+f x)-12 (a-b)^2 \tan ^2(e+f x)-24 (a-b)^2 \log (\cos (e+f x))+3 b^2 \tan ^8(e+f x)}{24 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^5*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-24*(a - b)^2*Log[Cos[e + f*x]] - 12*(a - b)^2*Tan[e + f*x]^2 + 6*(a - b)^2*Tan[e + f*x]^4 + 4*(2*a - b)*b*Ta
n[e + f*x]^6 + 3*b^2*Tan[e + f*x]^8)/(24*f)

________________________________________________________________________________________

Maple [B]  time = 0.006, size = 198, normalized size = 1.9 \begin{align*}{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{8}}{8\,f}}+{\frac{ab \left ( \tan \left ( fx+e \right ) \right ) ^{6}}{3\,f}}-{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{6}}{6\,f}}+{\frac{{a}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{4\,f}}-{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{4}ab}{2\,f}}+{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{4\,f}}-{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}{a}^{2}}{2\,f}}+{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}ab}{f}}-{\frac{{b}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){a}^{2}}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ab}{f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){b}^{2}}{2\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/8*b^2*tan(f*x+e)^8/f+1/3/f*a*b*tan(f*x+e)^6-1/6*b^2*tan(f*x+e)^6/f+1/4/f*a^2*tan(f*x+e)^4-1/2/f*tan(f*x+e)^4
*a*b+1/4/f*b^2*tan(f*x+e)^4-1/2/f*tan(f*x+e)^2*a^2+1/f*tan(f*x+e)^2*a*b-1/2*b^2*tan(f*x+e)^2/f+1/2/f*ln(1+tan(
f*x+e)^2)*a^2-1/f*ln(1+tan(f*x+e)^2)*a*b+1/2/f*ln(1+tan(f*x+e)^2)*b^2

________________________________________________________________________________________

Maxima [A]  time = 1.11073, size = 219, normalized size = 2.09 \begin{align*} -\frac{12 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac{24 \,{\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \sin \left (f x + e\right )^{6} - 6 \,{\left (11 \, a^{2} - 30 \, a b + 18 \, b^{2}\right )} \sin \left (f x + e\right )^{4} + 4 \,{\left (15 \, a^{2} - 38 \, a b + 22 \, b^{2}\right )} \sin \left (f x + e\right )^{2} - 18 \, a^{2} + 44 \, a b - 25 \, b^{2}}{\sin \left (f x + e\right )^{8} - 4 \, \sin \left (f x + e\right )^{6} + 6 \, \sin \left (f x + e\right )^{4} - 4 \, \sin \left (f x + e\right )^{2} + 1}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/24*(12*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2 - 1) - (24*(a^2 - 3*a*b + 2*b^2)*sin(f*x + e)^6 - 6*(11*a^2 -
 30*a*b + 18*b^2)*sin(f*x + e)^4 + 4*(15*a^2 - 38*a*b + 22*b^2)*sin(f*x + e)^2 - 18*a^2 + 44*a*b - 25*b^2)/(si
n(f*x + e)^8 - 4*sin(f*x + e)^6 + 6*sin(f*x + e)^4 - 4*sin(f*x + e)^2 + 1))/f

________________________________________________________________________________________

Fricas [A]  time = 1.19546, size = 265, normalized size = 2.52 \begin{align*} \frac{3 \, b^{2} \tan \left (f x + e\right )^{8} + 4 \,{\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{6} + 6 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} - 12 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} - 12 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/24*(3*b^2*tan(f*x + e)^8 + 4*(2*a*b - b^2)*tan(f*x + e)^6 + 6*(a^2 - 2*a*b + b^2)*tan(f*x + e)^4 - 12*(a^2 -
 2*a*b + b^2)*tan(f*x + e)^2 - 12*(a^2 - 2*a*b + b^2)*log(1/(tan(f*x + e)^2 + 1)))/f

________________________________________________________________________________________

Sympy [A]  time = 1.68333, size = 206, normalized size = 1.96 \begin{align*} \begin{cases} \frac{a^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac{a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac{a b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac{a b \tan ^{6}{\left (e + f x \right )}}{3 f} - \frac{a b \tan ^{4}{\left (e + f x \right )}}{2 f} + \frac{a b \tan ^{2}{\left (e + f x \right )}}{f} + \frac{b^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{b^{2} \tan ^{8}{\left (e + f x \right )}}{8 f} - \frac{b^{2} \tan ^{6}{\left (e + f x \right )}}{6 f} + \frac{b^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac{b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \tan ^{5}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**5*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**4/(4*f) - a**2*tan(e + f*x)**2/(2*f) - a*b
*log(tan(e + f*x)**2 + 1)/f + a*b*tan(e + f*x)**6/(3*f) - a*b*tan(e + f*x)**4/(2*f) + a*b*tan(e + f*x)**2/f +
b**2*log(tan(e + f*x)**2 + 1)/(2*f) + b**2*tan(e + f*x)**8/(8*f) - b**2*tan(e + f*x)**6/(6*f) + b**2*tan(e + f
*x)**4/(4*f) - b**2*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(a + b*tan(e)**2)**2*tan(e)**5, True))

________________________________________________________________________________________

Giac [B]  time = 17.9805, size = 5148, normalized size = 49.03 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/24*(12*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)
^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^8*tan(e)^8 - 24*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*
x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^8*tan(e)^8 + 12*b^2*log(4*(t
an(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
 + 1))*tan(f*x)^8*tan(e)^8 + 18*a^2*tan(f*x)^8*tan(e)^8 - 44*a*b*tan(f*x)^8*tan(e)^8 + 25*b^2*tan(f*x)^8*tan(e
)^8 - 96*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^
2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^7*tan(e)^7 + 192*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*
x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^7*tan(e)^7 - 96*b^2*log(4*(t
an(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
 + 1))*tan(f*x)^7*tan(e)^7 + 12*a^2*tan(f*x)^8*tan(e)^6 - 24*a*b*tan(f*x)^8*tan(e)^6 + 12*b^2*tan(f*x)^8*tan(e
)^6 - 120*a^2*tan(f*x)^7*tan(e)^7 + 304*a*b*tan(f*x)^7*tan(e)^7 - 176*b^2*tan(f*x)^7*tan(e)^7 + 12*a^2*tan(f*x
)^6*tan(e)^8 - 24*a*b*tan(f*x)^6*tan(e)^8 + 12*b^2*tan(f*x)^6*tan(e)^8 + 336*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x
)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan
(e)^6 - 672*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*
x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan(e)^6 + 336*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan
(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan(e)^6 - 6*a^2*tan(f*
x)^8*tan(e)^4 + 12*a*b*tan(f*x)^8*tan(e)^4 - 6*b^2*tan(f*x)^8*tan(e)^4 - 96*a^2*tan(f*x)^7*tan(e)^5 + 192*a*b*
tan(f*x)^7*tan(e)^5 - 96*b^2*tan(f*x)^7*tan(e)^5 + 324*a^2*tan(f*x)^6*tan(e)^6 - 872*a*b*tan(f*x)^6*tan(e)^6 +
 520*b^2*tan(f*x)^6*tan(e)^6 - 96*a^2*tan(f*x)^5*tan(e)^7 + 192*a*b*tan(f*x)^5*tan(e)^7 - 96*b^2*tan(f*x)^5*ta
n(e)^7 - 6*a^2*tan(f*x)^4*tan(e)^8 + 12*a*b*tan(f*x)^4*tan(e)^8 - 6*b^2*tan(f*x)^4*tan(e)^8 - 672*a^2*log(4*(t
an(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
 + 1))*tan(f*x)^5*tan(e)^5 + 1344*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*
x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^5*tan(e)^5 - 672*b^2*log(4*(tan(e)^2 + 1)/(tan(f
*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^5*t
an(e)^5 - 8*a*b*tan(f*x)^8*tan(e)^2 + 4*b^2*tan(f*x)^8*tan(e)^2 + 24*a^2*tan(f*x)^7*tan(e)^3 - 96*a*b*tan(f*x)
^7*tan(e)^3 + 48*b^2*tan(f*x)^7*tan(e)^3 + 276*a^2*tan(f*x)^6*tan(e)^4 - 672*a*b*tan(f*x)^6*tan(e)^4 + 336*b^2
*tan(f*x)^6*tan(e)^4 - 504*a^2*tan(f*x)^5*tan(e)^5 + 1296*a*b*tan(f*x)^5*tan(e)^5 - 816*b^2*tan(f*x)^5*tan(e)^
5 + 276*a^2*tan(f*x)^4*tan(e)^6 - 672*a*b*tan(f*x)^4*tan(e)^6 + 336*b^2*tan(f*x)^4*tan(e)^6 + 24*a^2*tan(f*x)^
3*tan(e)^7 - 96*a*b*tan(f*x)^3*tan(e)^7 + 48*b^2*tan(f*x)^3*tan(e)^7 - 8*a*b*tan(f*x)^2*tan(e)^8 + 4*b^2*tan(f
*x)^2*tan(e)^8 + 840*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2
 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 - 1680*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)
^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 + 84
0*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*t
an(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 - 3*b^2*tan(f*x)^8 + 16*a*b*tan(f*x)^7*tan(e) - 32*b^2*tan(f*x)^7*tan
(e) - 36*a^2*tan(f*x)^6*tan(e)^2 + 168*a*b*tan(f*x)^6*tan(e)^2 - 168*b^2*tan(f*x)^6*tan(e)^2 - 384*a^2*tan(f*x
)^5*tan(e)^3 + 1008*a*b*tan(f*x)^5*tan(e)^3 - 672*b^2*tan(f*x)^5*tan(e)^3 + 564*a^2*tan(f*x)^4*tan(e)^4 - 1368
*a*b*tan(f*x)^4*tan(e)^4 + 684*b^2*tan(f*x)^4*tan(e)^4 - 384*a^2*tan(f*x)^3*tan(e)^5 + 1008*a*b*tan(f*x)^3*tan
(e)^5 - 672*b^2*tan(f*x)^3*tan(e)^5 - 36*a^2*tan(f*x)^2*tan(e)^6 + 168*a*b*tan(f*x)^2*tan(e)^6 - 168*b^2*tan(f
*x)^2*tan(e)^6 + 16*a*b*tan(f*x)*tan(e)^7 - 32*b^2*tan(f*x)*tan(e)^7 - 3*b^2*tan(e)^8 - 672*a^2*log(4*(tan(e)^
2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))
*tan(f*x)^3*tan(e)^3 + 1344*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*t
an(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 672*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*
tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^
3 - 8*a*b*tan(f*x)^6 + 4*b^2*tan(f*x)^6 + 24*a^2*tan(f*x)^5*tan(e) - 96*a*b*tan(f*x)^5*tan(e) + 48*b^2*tan(f*x
)^5*tan(e) + 276*a^2*tan(f*x)^4*tan(e)^2 - 672*a*b*tan(f*x)^4*tan(e)^2 + 336*b^2*tan(f*x)^4*tan(e)^2 - 504*a^2
*tan(f*x)^3*tan(e)^3 + 1296*a*b*tan(f*x)^3*tan(e)^3 - 816*b^2*tan(f*x)^3*tan(e)^3 + 276*a^2*tan(f*x)^2*tan(e)^
4 - 672*a*b*tan(f*x)^2*tan(e)^4 + 336*b^2*tan(f*x)^2*tan(e)^4 + 24*a^2*tan(f*x)*tan(e)^5 - 96*a*b*tan(f*x)*tan
(e)^5 + 48*b^2*tan(f*x)*tan(e)^5 - 8*a*b*tan(e)^6 + 4*b^2*tan(e)^6 + 336*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*
tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^
2 - 672*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 + 336*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x
)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 6*a^2*tan(f*x)^4
 + 12*a*b*tan(f*x)^4 - 6*b^2*tan(f*x)^4 - 96*a^2*tan(f*x)^3*tan(e) + 192*a*b*tan(f*x)^3*tan(e) - 96*b^2*tan(f*
x)^3*tan(e) + 324*a^2*tan(f*x)^2*tan(e)^2 - 872*a*b*tan(f*x)^2*tan(e)^2 + 520*b^2*tan(f*x)^2*tan(e)^2 - 96*a^2
*tan(f*x)*tan(e)^3 + 192*a*b*tan(f*x)*tan(e)^3 - 96*b^2*tan(f*x)*tan(e)^3 - 6*a^2*tan(e)^4 + 12*a*b*tan(e)^4 -
 6*b^2*tan(e)^4 - 96*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2
 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 192*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 -
2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 96*b^2*log(
4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*ta
n(e) + 1))*tan(f*x)*tan(e) + 12*a^2*tan(f*x)^2 - 24*a*b*tan(f*x)^2 + 12*b^2*tan(f*x)^2 - 120*a^2*tan(f*x)*tan(
e) + 304*a*b*tan(f*x)*tan(e) - 176*b^2*tan(f*x)*tan(e) + 12*a^2*tan(e)^2 - 24*a*b*tan(e)^2 + 12*b^2*tan(e)^2 +
 12*a^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2
*tan(f*x)*tan(e) + 1)) - 24*a*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*t
an(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 12*b^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)
^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 18*a^2 - 44*a*b + 25*b^2)/(f*tan(f*x)
^8*tan(e)^8 - 8*f*tan(f*x)^7*tan(e)^7 + 28*f*tan(f*x)^6*tan(e)^6 - 56*f*tan(f*x)^5*tan(e)^5 + 70*f*tan(f*x)^4*
tan(e)^4 - 56*f*tan(f*x)^3*tan(e)^3 + 28*f*tan(f*x)^2*tan(e)^2 - 8*f*tan(f*x)*tan(e) + f)